Crate charls_sys

source ·

Re-exports§

Structs§

  • Defines the information that can be stored in a JPEG-LS Frame marker segment that applies to all scans. The JPEG-LS also allow to store sub-sampling information in a JPEG-LS Frame marker segment. CharLS does not support JPEG-LS images that contain sub-sampled scans.
  • Defines the JPEG-LS preset coding parameters as defined in ISO/IEC 14495-1, C.2.4.1.1. JPEG-LS defines a default set of parameters, but custom parameters can be used. When used these parameters are written into the encoded bit stream as they are needed for the decoding process.
  • Defines the information that can be stored in a SPIFF header as defined in ISO/IEC 10918-3, Annex F The type I.8 is an unsigned 8 bit integer, the type I.32 is an 32 bit unsigned integer in the file header itself. The type is indicated by the symbol “F.” are 4-byte parameters in “fixed point” notation. The 16 most significant bits are essentially the same as a parameter of type I.16 and indicate the integer part of this number. The 16 least significant bits are essentially the same as an I.16 parameter and contain an unsigned integer that, when divided by 65536, represents the fractional part of the fixed point number.

Constants§

Functions§

  • Creates a JPEG-LS decoder instance, when finished with the instance destroy it with the function charls_jpegls_decoder_destroy. A reference to a new created decoder instance, or a null pointer when the creation fails.
  • Will decode the JPEG-LS byte stream from the source buffer into the destination buffer. Function should be called after calling the function charls_jpegls_decoder_read_header. Reference to the decoder instance. Byte array that holds the encoded bytes when the function returns. Length of the array in bytes. If the array is too small the function will return an error. Number of bytes to the next line in the buffer, when zero, decoder will compute it. The result of the operation: success or a failure code.
  • Destroys a JPEG-LS decoder instance created with charls_jpegls_decoder_create and releases all internal resources attached to it. Instance to destroy. If a null pointer is passed as argument, no action occurs.
  • Returns the size required for the destination buffer in bytes to hold the decoded pixel data. Function should be called after calling the function charls_jpegls_decoder_read_header. Reference to the decoder instance. Number of bytes to the next line in the buffer, when zero, decoder will compute it. Output argument, will hold the required size when the function returns. The result of the operation: success or a failure code.
  • Returns information about the frame stored in the JPEG-LS byte stream. Function should be called after calling the function charls_jpegls_decoder_read_header. Reference to the decoder instance. Output argument, will hold the frame info when the function returns. The result of the operation: success or a failure code.
  • Reads the JPEG-LS header from the JPEG byte stream. After this function is called frame info can be retrieved. Reference to the decoder instance. The result of the operation: success or a failure code.
  • Tries to read the SPIFF header from the source buffer. If a SPIFF header exists its content will be put into the spiff_header parameter and header_found will be set to 1. Call charls_jpegls_decoder_read_header to read the normal JPEG header afterwards. Reference to the decoder instance. Output argument, will hold the SPIFF header when one could be found. Output argument, will hold 1 if a SPIFF header could be found, otherwise 0. The result of the operation: success or a failure code.
  • Set the reference to a source buffer that contains the encoded JPEG-LS byte stream data. This buffer needs to remain valid until the buffer is fully decoded. Reference to the decoder instance. Reference to the start of the source buffer. Size of the source buffer in bytes. The result of the operation: success or a failure code.
  • Creates a JPEG-LS encoder instance, when finished with the instance destroy it with the function charls_jpegls_encoder_destroy. A reference to a new created encoder instance, or a null pointer when the creation fails.
  • Destroys a JPEG-LS encoder instance created with charls_jpegls_encoder_create and releases all internal resources attached to it. Instance to destroy. If a null pointer is passed as argument, no action occurs.
  • Encodes the passed buffer with the source image data to the destination. Reference to the encoder instance. Byte array that holds the image data that needs to be encoded. Length of the array in bytes. The number of bytes from one row of pixels in memory to the next row of pixels in memory. Stride is sometimes called pitch. If padding bytes are present, the stride is wider than the width of the image. The result of the operation: success or a failure code.
  • Returns the size in bytes, that are written to the destination. Reference to the encoder instance. Reference to the size that will be set when the functions returns. The result of the operation: success or a failure code.
  • Returns the size in bytes, that the encoder expects are needed to hold the encoded image. Size for dynamic extras like SPIFF entries and other tables are not included in this size. Reference to the encoder instance. Reference to the size that will be set when the functions returns. The result of the operation: success or a failure code.
  • Set the reference to the destination buffer that will contain the encoded JPEG-LS byte stream data after encoding. This buffer needs to remain valid during the encoding process. Reference to the encoder instance. Reference to the start of the destination buffer. Size of the destination buffer in bytes. The result of the operation: success or a failure code.
  • Configures the encoding options the encoder should use. Default is charls_encoding_options::include_pc_parameters_jai Reference to the encoder instance. Options to use. The result of the operation: success or a failure code.
  • Configures the frame that needs to be encoded. This information will be written to the Start of Frame segment. Reference to the encoder instance. Information about the frame that needs to be encoded. The result of the operation: success or a failure code.
  • Configures the interleave mode the encoder should use. The default is none. The encoder expects the input buffer in the same format as the interleave mode. Reference to the encoder instance. Value of the interleave mode. The result of the operation: success or a failure code.
  • Configures the NEAR parameter the encoder should use. A value of 0 means lossless, 0 is also the default. Reference to the encoder instance. Value of the NEAR parameter. The result of the operation: success or a failure code.
  • Configures the preset coding parameters the encoder should use. If not set the encoder will use the default preset coding parameters as defined by the JPEG-LS standard. Only when the coding parameters are different than the default parameters or when `include_pc_parameters_jai` is set, they will be written to the JPEG-LS stream during the encode phase. Reference to the encoder instance. Reference to the preset coding parameters. The result of the operation: success or a failure code.

Type Aliases§